package com.cheetah.rest;

import com.cheetah.dto.UserDTO;
import com.cheetah.service.LoginOutService;
import com.cheetah.vo.UserVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Administrator
 * @Date 2019/9/11
 * @Version V1.0
 * @Description:
 **/
@RestController
@RequestMapping("/user")
@Slf4j
public class LoginOutRest {

    @Autowired
    private LoginOutService loginOutService;

    @PostMapping(value = "/login")
    public UserDTO login(UserVO userVO){
        UserDTO userDTO = loginOutService.login(userVO);
        //TODO 待补充业务逻辑
        return UserDTO.builder()
                .id("dfsdfsdf")
                .name("hxw")
                .password("sdf")
                .token(userDTO.getToken())
                .build();
    }

}
